const prefix: string = 'nh_'
const set = (key: string, value: any) => {
  uni.setStorageSync(`${prefix}${key}`, value)
}
const get = (key: string): any => {
  return uni.getStorageSync(`${prefix}${key}`)
}
const remove = (key: string) => {
  uni.removeStorageSync(`${prefix}${key}`)
}
const clear = () => {
  uni.clearStorageSync()
}
const setToken = (token: string) => {
  set(`token`, token)
}
const getToken = (): string => {
  return get(`token`)
}
export const useStorage = () => {
  return {
    set,
    get,
    remove,
    clear,
    setToken,
    getToken,
  }
}
